package group.sicher.common.entity;

import group.sicher.common.constant.senum.PayWayEnum;

import javax.persistence.*;
import java.util.Objects;

/**
 * @Auth rock
 * @Date 2019/7/1 21:07
 * @description
 */
@Entity
@Table(name = "wm_order")
public class OrderEntity {

    private Long id;
    private String orderCode;
    private Long consumerId;
    private Long shopId;
    private Integer boxCost;
    private Integer sendCost;
    private Integer totalMoney;
    private Integer discountMoney;
    private String couponId;
    private Integer couponMoney;
    private Integer payMoney;
    private PayWayEnum payWay;
    private Integer status;
    private Long arriveAt;
    private Long preArriveAt;
    private Long createAt;
    private Long updateAt;
    private String orderTimeOut;
    private String remark;
    private String cancelReason;
    private String driverMoney;
    private String shopMoney;

       @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "order_code", nullable = false, length = 50)
    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    @Basic
    @Column(name = "consumer_id", nullable = true)
    public Long getConsumerId() {
        return consumerId;
    }

    public void setConsumerId(Long consumerId) {
        this.consumerId = consumerId;
    }

    @Basic
    @Column(name = "shop_id", nullable = true)
    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    @Basic
    @Column(name = "box_cost", nullable = true, precision = 0)
    public Integer getBoxCost() {
        return boxCost;
    }

    public void setBoxCost(Integer boxCost) {
        this.boxCost = boxCost;
    }

    @Basic
    @Column(name = "send_cost", nullable = true, precision = 0)
    public Integer getSendCost() {
        return sendCost;
    }

    public void setSendCost(Integer sendCost) {
        this.sendCost = sendCost;
    }

    @Basic
    @Column(name = "total_money", nullable = true, precision = 0)
    public Integer getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(Integer totalMoney) {
        this.totalMoney = totalMoney;
    }

    @Basic
    @Column(name = "discount_money", nullable = true, precision = 0)
    public Integer getDiscountMoney() {
        return discountMoney;
    }

    public void setDiscountMoney(Integer discountMoney) {
        this.discountMoney = discountMoney;
    }

    @Basic
    @Column(name = "coupon_id", nullable = true, length = 50)
    public String getCouponId() {
        return couponId;
    }

    public void setCouponId(String couponId) {
        this.couponId = couponId;
    }

    @Basic
    @Column(name = "coupon_money", nullable = true, precision = 0)
    public Integer getCouponMoney() {
        return couponMoney;
    }

    public void setCouponMoney(Integer couponMoney) {
        this.couponMoney = couponMoney;
    }

    @Basic
    @Column(name = "pay_money", nullable = true, precision = 0)
    public Integer getPayMoney() {
        return payMoney;
    }

    public void setPayMoney(Integer payMoney) {
        this.payMoney = payMoney;
    }

    @Basic
    @Column(name = "pay_way", nullable = true)
    public PayWayEnum getPayWay() {
        return payWay;
    }

    public void setPayWay(PayWayEnum payWay) {
        this.payWay = payWay;
    }

    @Basic
    @Column(name = "status", nullable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "arrive_at", nullable = true)
    public Long getArriveAt() {
        return arriveAt;
    }

    public void setArriveAt(Long arriveAt) {
        this.arriveAt = arriveAt;
    }

    @Basic
    @Column(name = "pre_arrive_at", nullable = true)
    public Long getPreArriveAt() {
        return preArriveAt;
    }

    public void setPreArriveAt(Long preArriveAt) {
        this.preArriveAt = preArriveAt;
    }

    @Basic
    @Column(name = "create_at", nullable = true)
    public Long getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Long createAt) {
        this.createAt = createAt;
    }

    @Basic
    @Column(name = "update_at", nullable = true)
    public Long getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(Long updateAt) {
        this.updateAt = updateAt;
    }

    @Basic
    @Column(name = "order_time_out", nullable = true, length = 20)
    public String getOrderTimeOut() {
        return orderTimeOut;
    }

    public void setOrderTimeOut(String orderTimeOut) {
        this.orderTimeOut = orderTimeOut;
    }

    @Basic
    @Column(name = "remark", nullable = true, length = 500)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "cancel_reason", nullable = true, length = 255)
    public String getCancelReason() {
        return cancelReason;
    }

    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }

    @Basic
    @Column(name = "driver_money", nullable = true, length = 60)
    public String getDriverMoney() {
        return driverMoney;
    }

    public void setDriverMoney(String driverMoney) {
        this.driverMoney = driverMoney;
    }

    @Basic
    @Column(name = "shop_money", nullable = true, length = 255)
    public String getShopMoney() {
        return shopMoney;
    }

    public void setShopMoney(String shopMoney) {
        this.shopMoney = shopMoney;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrderEntity that = (OrderEntity) o;
        return id == that.id &&
                Objects.equals(orderCode, that.orderCode) &&
                Objects.equals(consumerId, that.consumerId) &&
                Objects.equals(shopId, that.shopId) &&
                Objects.equals(boxCost, that.boxCost) &&
                Objects.equals(sendCost, that.sendCost) &&
                Objects.equals(totalMoney, that.totalMoney) &&
                Objects.equals(discountMoney, that.discountMoney) &&
                Objects.equals(couponId, that.couponId) &&
                Objects.equals(couponMoney, that.couponMoney) &&
                Objects.equals(payMoney, that.payMoney) &&
                Objects.equals(payWay, that.payWay) &&
                Objects.equals(status, that.status) &&
                Objects.equals(arriveAt, that.arriveAt) &&
                Objects.equals(preArriveAt, that.preArriveAt) &&
                Objects.equals(createAt, that.createAt) &&
                Objects.equals(updateAt, that.updateAt) &&
                Objects.equals(orderTimeOut, that.orderTimeOut) &&
                Objects.equals(remark, that.remark) &&
                Objects.equals(cancelReason, that.cancelReason) &&
                Objects.equals(driverMoney, that.driverMoney) &&
                Objects.equals(shopMoney, that.shopMoney);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, orderCode, consumerId, shopId, boxCost, sendCost, totalMoney, discountMoney, couponId, couponMoney, payMoney, payWay, status, arriveAt, preArriveAt, createAt, updateAt, orderTimeOut, remark, cancelReason, driverMoney, shopMoney);
    }
}
